package com.aspose.cells;

class zxr extends zbz {
   zxr() {
      this.c(49);
   }

   private int a(Font var1, boolean[] var2) {
      var2[0] = true;
      return var1.b.a() ? 32767 : var1.b.b(var1.c, 32767, var2);
   }

   zbvr a(Font var1, int var2) throws Exception {
      zbvr var3 = null;
      byte[] var4 = Encoding.getUnicode().a(var1.getName());
      int var5 = var1.getName().length();
      this.a((short)(16 + 2 * var5));
      this.c = new byte[this.d()];
      this.c[14] = (byte)var5;
      this.c[15] = 1;
      System.arraycopy(var4, 0, this.c, 16, 2 * var5);
      System.arraycopy(com.aspose.cells.b.a.zc.a((short)var1.i()), 0, this.c, 0, 2);
      int var6 = 0;
      if (var1.isBold()) {
         var6 |= 1;
      }

      if (var1.isItalic()) {
         var6 |= 2;
      }

      if (var1.isStrikeout()) {
         var6 |= 8;
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var6), 0, this.c, 2, 2);
      boolean var7 = true;
      boolean[] var8 = new boolean[]{var7};
      int var9 = this.a(var1, var8);
      var7 = var8[0];
      if (var9 == -1) {
         this.c[4] = -1;
         this.c[5] = 127;
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var9), 0, this.c, 4, 2);
      }

      if (!var7) {
         if (var3 == null) {
            var3 = new zbvr();
         }

         var3.a(13, var1.b);
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a((short)var1.g()), 0, this.c, 6, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a((short)var1.e()), 0, this.c, 8, 2);
      switch(var1.getUnderline()) {
      case 1:
         this.c[10] = 1;
         break;
      case 2:
         this.c[10] = 2;
         break;
      case 3:
         this.c[10] = 33;
         break;
      case 4:
         this.c[10] = 34;
      }

      this.c[11] = var1.h();
      this.c[12] = (byte)var1.getCharset();
      this.c[13] = 0;
      return var3;
   }
}
